select FORMMAIN_0067.ID as TWOID,formson_0068.ID,formson_0068.field0037,formson_0068.field0068,formson_0068.FORMMAIN_ID,formson_0068.FIELD0059,formson_0068.FIELD0069 , formson_0068.FIELD0010,formmain_0150.FIELD0002 as "Jbtype",
formson_0068.FIELD0067,formson_0068.FIELD0011,FORMMAIN_0067.field0012,
COL_SUMMARY.id as "Liuc",formson_0068.FORMMAIN_ID as "Fid",
ORG_MEMBER.NAME as USERNAME,ORG_UNIT.NAME as DEPTNAME,"temp_org_member_group"."company"as ADDRESS,
FORMSON_0068.ID as "CID",to_char(FORMSON_0068.FIELD0010,'yyyyMMdd') as "BEGDAY",to_char(FORMSON_0068.FIELD0011,'yyyyMMdd') as "ENDDAY",
to_char(FORMSON_0068.FIELD0010,'HH24:MI') as "BEGTIME",to_char(FORMSON_0068.FIELD0011,'HH24:MI') as "ENDTIME",
FORMMAIN_0067.field0001 as "DJLSH",formmain_0067.field0095 as "BT",
FORMSON_0068.ID as "邮箱唯一编号",formson_0068.field0037 as "G-HR职员编号",FORMMAIN_0067.ID as "SEQ",
formmain_0150.FIELD0002 as "出差代码",formson_0068.FIELD0059 as "出差类别",
to_char(FORMSON_0068.FIELD0010,'yyyyMMdd') as "出差开始日期",
to_char(FORMSON_0068.FIELD0011,'yyyyMMdd') as "出差结束日期",
to_char(FORMSON_0068.FIELD0010,'HH24:MI') as "出差开始时间",
to_char(FORMSON_0068.FIELD0011,'HH24:MI') as "出差结束时间",
formson_0068.FIELD0067 as "合计天数",FORMMAIN_0067.field0012 as "事由"
from FORMSON_0068 
left outer join  FORMMAIN_0067 on formson_0068.FORMMAIN_ID=FORMMAIN_0067.ID
left outer join  COL_SUMMARY on formson_0068.FORMMAIN_ID=COL_SUMMARY.form_recordid
LEFT outer JOIN ORG_MEMBER ON ORG_MEMBER.CODE = formson_0068.FIELD0037
LEFT outer JOIN "temp_org_member_group" ON ORG_MEMBER.ID = "temp_org_member_group"."member_id"
LEFT outer JOIN ORG_UNIT ON ORG_MEMBER.ORG_DEPARTMENT_ID = ORG_UNIT."ID" 
LEFT outer JOIN formmain_0150 on formson_0068.FIELD0068=formmain_0150.FIELD0001
where formson_0068.FORMMAIN_ID=?
AND ORG_MEMBER.IS_ENABLE = 1 AND ORG_MEMBER.IS_DELETED = 0